package com.ruoyi.third.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.third.service.IThirdPlatformService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.third.mapper.ThirdConfigValueMapper;
import com.ruoyi.third.domain.ThirdConfigValue;
import com.ruoyi.third.service.IThirdConfigValueService;

/**
 * 配置值Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-02-06
 */
@Service
public class ThirdConfigValueServiceImpl implements IThirdConfigValueService 
{
    private static final Logger log = LoggerFactory.getLogger(ThirdConfigValueServiceImpl.class);

    @Autowired
    private IThirdPlatformService thirdPlatformService;
    @Autowired
    private ThirdConfigValueMapper thirdConfigValueMapper;

    /**
     * 查询配置值
     * 
     * @param id 配置值主键
     * @return 配置值
     */
    @Override
    public ThirdConfigValue selectThirdConfigValueById(Long id)
    {
        return thirdConfigValueMapper.selectThirdConfigValueById(id);
    }

    /**
     * 查询配置值列表
     * 
     * @param thirdConfigValue 配置值
     * @return 配置值
     */
    @Override
    public List<ThirdConfigValue> selectThirdConfigValueList(ThirdConfigValue thirdConfigValue)
    {
        return thirdConfigValueMapper.selectThirdConfigValueList(thirdConfigValue);
    }

    /**
     * 新增配置值
     * 
     * @param thirdConfigValue 配置值
     * @return 结果
     */
    @Override
    public int insertThirdConfigValue(ThirdConfigValue thirdConfigValue)
    {
        thirdPlatformService.reCache();
        thirdConfigValue.setCreateTime(DateUtils.getNowDate());
        return thirdConfigValueMapper.insertThirdConfigValue(thirdConfigValue);
    }

    /**
     * 修改配置值
     * 
     * @param thirdConfigValue 配置值
     * @return 结果
     */
    @Override
    public int updateThirdConfigValue(ThirdConfigValue thirdConfigValue)
    {
        thirdConfigValue.setUpdateTime(DateUtils.getNowDate());
        thirdPlatformService.reCache();
        return thirdConfigValueMapper.updateThirdConfigValue(thirdConfigValue);
    }

    /**
     * 批量删除配置值
     * 
     * @param ids 需要删除的配置值主键
     * @return 结果
     */
    @Override
    public int deleteThirdConfigValueByIds(Long[] ids)
    {
        thirdPlatformService.reCache();
        return thirdConfigValueMapper.deleteThirdConfigValueByIds(ids);
    }

    /**
     * 删除配置值信息
     * 
     * @param id 配置值主键
     * @return 结果
     */
    @Override
    public int deleteThirdConfigValueById(Long id)
    {
        thirdPlatformService.reCache();
        return thirdConfigValueMapper.deleteThirdConfigValueById(id);
    }
}
